//package com.itheima.config;
//
//import com.itheima.interceptors.LoginInterceptor;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
//import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
//import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
//
//@Configuration
//public class MyInterceptorConfig extends WebMvcConfigurationSupport {
//
//    private String UPLOAD_FOLDER= "D:\\cad\\vue\\毕业论文\\guanhuaer\\roomhotel\\src\\main\\resources\\static\\img";
//    @Autowired
//    private LoginInterceptor loginInterceptor;
//    @Override
//    protected void addInterceptors(InterceptorRegistry registry) {
//        registry.addInterceptor(loginInterceptor)
//                .addPathPatterns("/upload")
//                .excludePathPatterns("/login")
//                .excludePathPatterns("/**")
//                .excludePathPatterns("/img/**");
//    }
//
//    @Override
//    public void addResourceHandlers(ResourceHandlerRegistry registry) {
//        registry.addResourceHandler("/img/**").addResourceLocations("file:" + UPLOAD_FOLDER);
//    }
//}
